//路由配置文件
import {
  createRouter,
  createWebHashHistory,
  createWebHistory,
} from "vue-router";
const router = createRouter({
  history: createWebHashHistory(), //路由模式，哈希模式
  //路由映射关系配置 （路径---组件）
  routes: [
    {
      path: "/",
      component: () => import("../layout/index.vue"),
      children: [
        {
          path: "/dashboard",
          component: () => import("../views/dashboard.vue"),
        },
        {
          path: "/category/list",
          component: () => import("../views/category/list.vue"),
        },
        {
          path: "/category/pub",
          component: () => import("../views/category/pub.vue"),
        },
      ],
    },
  ],
});

export default router;
